import { IonContent } from "@ionic/react";
import TypeWriter from "@repo/components/src/TypeWriter/TypeWriter";
import { homeStore } from "@/store/homeStore.js";
import { useEffect } from "react";
import { useHistory } from "react-router";

export default function HomeContent() {
    const { count, text } = homeStore();
    const history = useHistory();

    useEffect(() => {
        console.log("HomeContent render");
        history.push("/conversation");
    }, []);

    return (
        <IonContent>
            <div>{count}</div>
            <div>首页</div>
            <TypeWriter text={text} />
            <div>是否登录，未登录跳转登录页</div>
        </IonContent>
    );
}
